-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom project root setting #5769
Conversation
9e86b51
to
cf13700
Compare
} | ||
): Option[AbsolutePath] = { | ||
customProjectRoot match { | ||
case Some(projectRoot) => Some(projectRoot).filter(isProjectRoot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case Some(projectRoot) => Some(projectRoot).filter(isProjectRoot) | |
case Some(projectRoot) if isProjectRoot(projectRoot) => Some(projectRoot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's on purpose like this. So if you choose a custom root it should look only in that root. We had a problem discussed on discord, where a person had a custom bsp and an unused sbt
somewhere lower file hierarchy.
userConfig().customProjectRoot | ||
.map(_.trim() match { | ||
case "." => workspace | ||
case relativePath => workspace.resolve(relativePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure, if customProjectRoot is empty (Some("")
) it resolves to workspace here and works as if it was None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty is filtered out while fromJson
on the whole UserConfig
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just two minor comments
case "." => workspace | ||
case relativePath => workspace.resolve(relativePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workspace.resolve(".") will amount to the same
case "." => workspace | |
case relativePath => workspace.resolve(relativePath) | |
case relativePath => workspace.resolve(relativePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about Windows.
"custom-project-root", | ||
"""empty string `""`.""", | ||
""""backend/scalaProject/"""", | ||
"Scala CLI launcher", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Scala CLI launcher", | |
"Custom project root", |
cf13700
to
e20c606
Compare
No description provided.